﻿@{
    ViewData["Title"] = "角色";
}
@model LoginViewModel
<div class="panel panel-default">
    <div class="form-content">
        <div class="form-body">
            <div class="row" id="filter" data-toggle="form" data-field="Role" data-grid="#grid" data-filterable="true">
                <input data-field="name" placeholder="请输入 角色名称 模糊查询" data-size="4,0,12" data-logic="or" data-operator="contains" />
                <button data-button="query">查询</button>
                <button data-button="clear">清除条件</button>
                <div class="pull-right" style="padding-right:15px;">
                    <button data-button="add" data-popup="Edit">新 增</button>
                </div>
            </div>
            <div id="grid" data-toggle="grid" data-form="#filter" node="grid" data-related="#_PopupDetail">
                <div node="columns" node-type="array">
                    <span data-field="image" data-title="角色图片" data-type="image"></span>
                    <span data-field="name" data-title="角色名称"></span>
                    <span data-field="alias" data-title="昵称/别名"></span>
                    <span data-field="type" data-title="角色类型" data-data-from="cache.authorizeType"></span>
                    <span data-field="description" data-title="备注说明"></span>
                    <span data-field="state" data-title="状态" data-data-from="cache.dataState" data-hidden="true"></span>
                    <span data-field="createdOn" data-title="创建时间" data-type="datetime" data-hidden="true"></span>
                </div>
                <span node="dataSource">
                    <span node="transport">
                        <span node="read" data-url="/odata/Roles">
                        </span>
                    </span>
                    <span node="sort" data-field="name" data-dir="asc"></span>
                </span>
            </div>
        </div>
    </div>
</div>

<div id="_PopupDetail" data-toggle="popup" data-type="Detail" data-title="角色信息">
    <div class="popup-content" data-toggle="form" data-field="Role" data-url="/api/Roles" data-detailable="true" data-size="12,4,8">
        <div class="popup-body">
            <div class="form-content">
                <div class="form-body">
                    <div data-field="image" data-title="角色图片" data-type="img" data-business-type="Role" data-single="true"></div>
                    <span data-field="name" data-title="角色名称"></span>
                    <span data-field="alias" data-title="角色别名"></span>
                    <span data-field="type" data-title="角色类型" data-data-from="cache.authorizeType"></span>
                    <span data-field="state" data-title="状态" data-data-from="cache.dataState"></span>
                    <span data-field="description" data-title="备注说明"></span>
                </div>
            </div>
        </div>
        <div class="popup-footer text-right">
            <button data-button="edit" data-popup="Edit"></button>
            <button data-button="delete"></button>
            <button data-button="close"></button>
        </div>
    </div>
</div>

<div id="_PopupEdit" data-toggle="popup" data-type="Edit" data-title="角色信息" data-related="#filter" data-size="large">
    <div class="popup-content" data-toggle="form" data-field="Role" data-editable="true" data-url="/api/Roles" data-size="12,3,7">
        <div class="popup-body">
            <div class="form-content">
                <div class="form-body">
                    <input data-field="name" data-title="角色名称" required />
                    <input data-field="alias" data-title="角色别名" />
                    <span data-field="type" data-title="角色类型" required type="radio" data-size="12,3,9" data-with-group="true" data-data="#:cache.authorizeType" data-value="Internal" data-data-value-field="value"></span>
                    <span data-field="state" data-title="状态" required type="radio" data-size="12,3,9" data-with-group="true" data-data="#:cache.dataState" data-value="Available"></span>
                    <textarea data-field="description" data-title="备注说明" rows="3" data-multiple="true"></textarea>
                    <input data-field="image" data-title="角色图片" data-with-attachments="true" data-business-type="Role" data-single="true" type="file" data-role="kendoUpload" data-file-size="1024" data-file-extension=".jpg,.jpeg,.png" />
                </div>
            </div>
        </div>
        <div class="popup-footer text-right">
            <button data-button="post"></button>
            <button data-button="put"></button>
            <button data-button="close"></button>
        </div>
    </div>
</div>